import React, {
  Component
} from 'react'
import PropTypes from 'prop-types'
import ThemeSwitch from './ThemeSwitch.js'
import { connect } from 'react-redux'
class Content extends Component {
  static contextTypes={
    themeColor:PropTypes.object
  }
  render() {
    return ( <div>
      <p style={{color:this.props.themeColor}}> React.js 小书内容 </p> 
      <ThemeSwitch/>
      </div>
    )
  }
}

const mapToStateProps=(state)=>{
  return {
    themeColor:state.themeColor
  }
}

Content=connect(mapToStateProps)(Content)
export default Content